package duoqiao;

import java.io.BufferedOutputStream;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;

public class FlushDemo {
    public static void main(String[] args) throws Exception {
        //要写出，所以FileOutputStream
        FileOutputStream fos = new FileOutputStream("book.txt");
        BufferedOutputStream bos = new BufferedOutputStream(fos);

        String line = "好好学习";
        byte[] data = line.getBytes(StandardCharsets.UTF_8);
        bos.write(data);
       // bos.flush();
        System.out.println("写出完毕");
        bos.close();
    }
}
